package com.ziyia.wim.pojo;

import android.os.HandlerThread;
import android.util.Log;

import androidx.recyclerview.widget.RecyclerView;

import com.alibaba.fastjson.JSON;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

public class Client extends WebSocketClient {

    public Client(URI serverUri) {
        super(serverUri, new Draft_6455());
    }

    @Override
    public void onOpen(ServerHandshake handshakedata) {

    }

    @Override
    public void onMessage(String message) {
//                Intent intent = new Intent();
//                intent.setAction("com.xch.servicecallback.content");
//                intent.putExtra("message", message);
//                sendBroadcast(intent);
//                Log.d("message", message);
    ;
    }

    @Override
    public void onClose(int code, String reason, boolean remote) {
        Log.e("Client", "onClose()");
    }

    @Override
    public void onError(Exception ex) {
        String message = ex.getMessage();
        System.out.println(message);
    }

}